package cn.learn.designpattern.decorator.beverage;

/**
 * 浓缩咖啡
 *
 * @author huangyezhan
 * @date 2019年02月23日23:50
 */
public class Espresso extends Beverage {

    public Espresso() {
        description = "Espresso";
    }

    @Override
    public double cost() {
        return 1.2;
    }

}

/**
 * 普通咖啡
 */
class HouseBlend extends Beverage {

    public HouseBlend() {
        description = "House Blend Coffee";
    }

    @Override
    public double cost() {
        return 2.4;
    }

}

/**
 * Mocha咖啡
 */
class Mocha extends CondimentDecorator {
    public Beverage beverage;

    public Mocha(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Mocha";
    }

    @Override
    public double cost() {
        return 2.0 + beverage.cost();
    }

}

